<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <addParamConfig @fatherMethod="submitCallback" ref="paramconfig"></addParamConfig>
  </j-modal>
</template>

<script>
  import { httpAction } from '@/api/manage'
  import addParamConfig from './addParamConfig'

  export default {
    name: 'addParamConfigModal',
    components: {
      addParamConfig
    },
    data () {
      return {
        model:{
        },
        title:'行内编码',
        width:900,
        visible: false,
        disableSubmit: false
      }
    },
    methods: {
      showModal(id,type) {
        //用于弹出框类型
        this.visible = true;
        this.$nextTick(()=>{
          this.$refs.paramconfig.initData(id,type)
        })

      /*  this.$nextTick(()=>{
          this.$refs.hnCodeList.getId(id)
        })*/
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk(e) {
        this.$nextTick(()=>{
          this.$refs.paramconfig.addData()
        })
      },
      submitCallback(){
        this.$parent.$parent.getId(this.$refs.paramconfig.parentId,this.$refs.paramconfig.codeType)
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>